package com.kaifamiao.buffer;

public class StringBufferTest3 {

	public static void main(String[] args) {
		
		StringBuffer buffer = new StringBuffer( "kaifamiao开发喵" );
		System.out.println( buffer.length() + " , " + buffer.capacity() );
		
		int first = buffer.indexOf( "a" , 3 );
		System.out.println( first );
		
		int last = buffer.lastIndexOf( "a" );
		System.out.println( last );
		
		last = buffer.lastIndexOf( "a" , last - 1 );
		System.out.println( last );
		
		CharSequence cs = buffer.subSequence( 5 ,  9 );
		System.out.println( cs );
		
		String sub1 = buffer.substring( 5 );
		System.out.println( sub1 );
		
		String sub2 = buffer.substring( 5 ,  9 );
		System.out.println( sub2 );

	}

}
